home *** CD-ROM | disk | FTP | other *** search
-
- SHMALLOC(3C) SHMALLOC(3C)
-
-
- NNNNAAAAMMMMEEEE
- sssshhhhmmmmaaaalllllllloooocccc, sssshhhhffffrrrreeeeeeee, sssshhhhmmmmeeeemmmmaaaalllliiiiggggnnnn, sssshhhhrrrreeeeaaaalllllllloooocccc, sssshhhhmmmmaaaalllllllloooocccc____cccchhhheeeecccckkkk,
- sssshhhhmmmmaaaalllllllloooocccc____ssssttttaaaattttssss - Symmetric heap memory management functions
-
- SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
- ####iiiinnnncccclllluuuuddddeeee <<<<mmmmpppppppp////sssshhhhmmmmeeeemmmm....hhhh>>>>
-
- vvvvooooiiiidddd ****sssshhhhmmmmaaaalllllllloooocccc((((ssssiiiizzzzeeee____tttt _s_i_z_e))));;;;
-
- vvvvooooiiiidddd sssshhhhffffrrrreeeeeeee((((vvvvooooiiiidddd ****_p_t_r))));;;;
-
- vvvvooooiiiidddd ****sssshhhhrrrreeeeaaaalllllllloooocccc((((vvvvooooiiiidddd ****_p_t_r,,,, ssssiiiizzzzeeee____tttt _s_i_z_e))));;;;
-
- vvvvooooiiiidddd ****sssshhhhmmmmeeeemmmmaaaalllliiiiggggnnnn((((ssssiiiizzzzeeee____tttt _a_l_i_g_n_m_e_n_t,,,, ssssiiiizzzzeeee____tttt _s_i_z_e))));;;;
-
- iiiinnnntttt sssshhhhmmmmaaaalllllllloooocccc____cccchhhheeeecccckkkk((((iiiinnnntttt _l_e_v_e_l))));;;;
-
- vvvvooooiiiidddd sssshhhhmmmmaaaalllllllloooocccc____ssssttttaaaattttssss((((iiiinnnntttt _l_e_v_e_l))));;;;
-
- eeeexxxxtttteeeerrrrnnnn lllloooonnnngggg mmmmaaaalllllllloooocccc____eeeerrrrrrrroooorrrr;;;;
-
- SSSSTTTTAAAANNNNDDDDAAAARRRRDDDDSSSS
- SGI extension
-
- DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
- The sssshhhhmmmmaaaalllllllloooocccc function returns a pointer to a block of at least _s_i_z_e
- bytes suitably aligned for any use. This space is allocated from the
- symmetric heap (in contrast to mmmmaaaalllllllloooocccc(3C), which allocates from the
- private heap).
-
- The sssshhhhmmmmeeeemmmmaaaalllliiiiggggnnnn function allocates a block in the symmetric heap that
- has a byte alignment specified by the _a_l_i_g_n_m_e_n_t argument.
-
- The sssshhhhffffrrrreeeeeeee function causes the block to which _p_t_r points to be
- deallocated, that is, made available for further allocation. If _p_t_r
- is a null pointer, no action occurs; otherwise, if the argument does
- not match a pointer earlier returned by a symmetric heap function, or
- if the space has already been deallocated, mmmmaaaalllllllloooocccc____eeeerrrrrrrroooorrrr is set to
- indicate the error, and sssshhhhffffrrrreeeeeeee returns.
-
- The sssshhhhrrrreeeeaaaalllllllloooocccc function changes the size of the block to which _p_t_r
- points to the size (in bytes) specified by _s_i_z_e. The contents of the
- block are unchanged up to the lesser of the new and old sizes. If the
- new size is larger, the value of the newly allocated portion of the
- block is indeterminate. If _p_t_r is a null pointer, the sssshhhhrrrreeeeaaaalllllllloooocccc
- function behaves like the sssshhhhmmmmaaaalllllllloooocccc function for the specified size.
- If _s_i_z_e is 0 and _p_t_r is not a null pointer, the block to which it
- points is freed. Otherwise, if _p_t_r does not match a pointer earlier
- returned by a symmetric heap function, or if the space has already
- been deallocated, the mmmmaaaalllllllloooocccc____eeeerrrrrrrroooorrrr variable is set to indicate the
- error, and sssshhhhrrrreeeeaaaalllllllloooocccc returns a null pointer. If the space cannot be
- allocated, the block to which _p_t_r points is unchanged.
-
- The sssshhhhmmmmaaaalllllllloooocccc, sssshhhhffffrrrreeeeeeee, and sssshhhhrrrreeeeaaaalllllllloooocccc functions are provided so that
- multiple PEs in an application can allocate symmetric, remotely
- accessible memory blocks. these memory blocks can then be used with
- the symmetric memory (sssshhhhmmmmeeeemmmm) library. Each of these functions call
- the sssshhhhmmmmeeeemmmm____bbbbaaaarrrrrrrriiiieeeerrrr____aaaallllllll(3) function before returning; this ensures that
- all PEs participate in the memory allocation, and that the memory on
- other PEs can be used as soon as the local PE returns. The user is
- responsible for calling these functions with identical argument(s) on
- all PEs; if differing _s_i_z_e arguments are used, subsequent calls may
- not return the same symmetric heap address on all PEs.
-
- The sssshhhhmmmmaaaalllllllloooocccc____cccchhhheeeecccckkkk function checks the consistency of sssshhhhmmmmaaaalllllllloooocccc's
- memory structure. If _l_e_v_e_l is less than 0, sssshhhhmmmmaaaalllllllloooocccc____cccchhhheeeecccckkkk silently
- performs validation of the symmetric heap, and returns 0 if the heap
- is consistent, or nonzero if the heap has been corrupted. If _l_e_v_e_l
- equals 0, sssshhhhmmmmaaaalllllllloooocccc____cccchhhheeeecccckkkk prints a message to ssssttttddddeeeerrrrrrrr that describes the
- first inconsistency found. If _l_e_v_e_l is greater than 0,
- sssshhhhmmmmaaaalllllllloooocccc____cccchhhheeeecccckkkk prints a line to ssssttttddddeeeerrrrrrrr that describes each symmetric
- heap block in addition to checking the symmetric heap.
-
- The sssshhhhmmmmaaaalllllllloooocccc____ssssttttaaaattttssss function prints out memory manager statistics and
- heap block information to ssssttttddddoooouuuutttt. If _l_e_v_e_l equals 0, sssshhhhmmmmaaaalllllllloooocccc____ssssttttaaaattttssss
- reports the number of calls to each symmetric heap function, as well
- as summary statistics on the number and total size of the busy blocks,
- free blocks, and "spec" blocks (that is, blocks that are created by
- user calls to sssshhhhssssbbbbrrrreeeeaaaakkkk) in the symmetric heap. If _l_e_v_e_l equals 1,
- sssshhhhmmmmaaaalllllllloooocccc____ssssttttaaaattttssss prints a line with a **** for each busy block, a .... for
- each free block, and a @@@@ for each "spec" block, in addition to the
- level 0 statistics. If _l_e_v_e_l equals 2, sssshhhhmmmmaaaalllllllloooocccc____ssssttttaaaattttssss prints a line
- that describes each symmetric heap block, in addition to the level 0
- statistics. The number of calls for each function are available only
- by linking with the lllliiiibbbbmmmmaaaalllllllloooocccc library; all of the other information is
- available in the default memory manager.
-
- CCCCAAAAUUUUTTTTIIIIOOOONNNNSSSS
- The sssshhhhmmmmaaaalllllllloooocccc, sssshhhhffffrrrreeeeeeee, and sssshhhhrrrreeeeaaaalllllllloooocccc functions differ from the private
- heap allocation functions in that all PEs in an application must call
- them (a barrier is used to ensure this). The sssshhhhmmmmaaaalllllllloooocccc____cccchhhheeeecccckkkk, and
- sssshhhhmmmmaaaalllllllloooocccc____ssssttttaaaattttssss functions do not use a barrier, and can be used by a
- subset of all PEs.
-
- RRRREEEETTTTUUUURRRRNNNN VVVVAAAALLLLUUUUEEEESSSS
- The sssshhhhmmmmaaaalllllllloooocccc function returns a pointer to the allocated space (which
- should be identical on all PEs); otherwise, it returns a null pointer
- (with mmmmaaaalllllllloooocccc____eeeerrrrrrrroooorrrr set).
-
- The sssshhhhffffrrrreeeeeeee and sssshhhhmmmmaaaalllllllloooocccc____ssssttttaaaattttssss functions return no value.
-
- The sssshhhhrrrreeeeaaaalllllllloooocccc function returns a pointer to the allocated space (which
- may have moved); otherwise, it returns a null pointer (with
- mmmmaaaalllllllloooocccc____eeeerrrrrrrroooorrrr set).
-
- If the symmetric heap has been corrupted, the sssshhhhmmmmaaaalllllllloooocccc____cccchhhheeeecccckkkk function
- returns nonzero; otherwise, it returns 0.
-
- SSSSEEEEEEEE AAAALLLLSSSSOOOO
- iiiinnnnttttrrrroooo____sssshhhhmmmmeeeemmmm(3), mmmmaaaalllllllloooocccc(3C), mmmmaaaalllllllloooocccc....hhhh(3C)
-
- bbbbrrrrkkkk(2)
-